package com.huatai.datacenter.controller.fire;

import com.alibaba.fastjson.JSONObject;
import com.huatai.datacenter.controller.fire.retention.ApiCheck;
import com.huatai.dataservice.fire.feign.FireClient;
import com.huatai.dataservice.fire.firemodel.FireResponseVo;
import com.huatai.dataservice.fire.firemodel.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @ClassName FireWarningMonitoringController
 * @Description TODO
 * @Author gaowengui
 * @Date 2025/6/5 15:20:44
 * @Version 1.0
 */

@RestController
@RequestMapping("/fire/api")
@Slf4j
@Api(tags = "火灾监测与预警",value = "火灾监测与预警")
public class FireWarningMonitoringDDController {

	@Autowired
	private FireClient fireClient;

	/**
	 * @author gaowengui
	 * 获取消防重点部位安全情况
	 */
	@ApiOperation("获取消防重点部位安全情况")
	@GetMapping("/getSafeUnitList")
	@ApiCheck//自定义注解
	public FireResponseVo getSafeUnitList(){
		return fireClient.selectFireSafetySituation();
	}

	/**
	 * @author  gaowengui
	 * 获取该重点部位的安全评分详情报告
	 */
	@ApiOperation("获取该重点部位的安全评分详情报告")
	@GetMapping("/getSafeListDetail")
	@ApiCheck
	public FireResponseVo getSafeListDetail(@RequestParam("id") String id){
		return fireClient.selectSafeListDetail(id);
	}

	/**
	 * @author gaowengui
	 * 获取隐患告警总览统计数据
	 */
	@ApiOperation("获取隐患告警总览统计数据")
	@GetMapping("getSafeAlarmOverall")
	@ApiCheck
	public FireResponseVo getSafeAlarmOverall(){
		return fireClient.getSafeAlarmOverall();
	}

	/**
	 * @Description 获取隐患告警类别分布数据
	 * @author gaowengui
	 * @return fireResponseVo
	 */
	@ApiOperation("获取隐患告警类别分布数据")
	@GetMapping("/getSafeAlarmByClass")
	@ApiCheck
	public ResponseVo getSafeAlarmByClass(){
		return fireClient.selectSafeAlarmByClass();
	}

	/**
	 * @author gaowengui
	 * 获取隐患告警解决情况分布数据
	 * @return
	 */
	@ApiOperation("获取隐患告警解决情况分布数据")
	@GetMapping("/getSafeAlarmSolve")
	@ApiCheck
	public ResponseVo getSafeAlarmSolve(){
		return fireClient.getSafeAlarmOverallSolve();
	}

	/**
	 * @author gaowengui
	 * 获取所有隐患告警记录
	 * @return
	 */
	@ApiOperation("获取所有隐患告警记录")
	@GetMapping("/getSafeAlarmLog")
	@ApiCheck
	public FireResponseVo getSafeAlarmLog(){
		FireResponseVo fireResponseVo = fireClient.getSafeAlarmLog();
		return fireResponseVo;
	}

	@ApiOperation("获取指定类型的隐患告警的区域分布")
	@GetMapping("/getSafeAlarmDistributionByClass")
	@ApiCheck
	public ResponseVo getSafeAlarmByClasss(String className){
		return fireClient.getSafeAlarmByClasss(className);

	}

	@ApiOperation("获取隐患巡察任务情况数据")
	@GetMapping("/getPatrol")
	@ApiCheck
	public FireResponseVo getPatrol(){
		FireResponseVo fireResponseVo = fireClient.getPatrol();
		return fireResponseVo;
	}
}
